Eclipse Platform
Pre-release 3.0

org.eclipse.team.core.sync
Class RemoteSyncElement

java.lang.Object
  extended byorg.eclipse.team.core.sync.LocalSyncElement
      extended byorg.eclipse.team.core.sync.RemoteSyncElement
All Implemented Interfaces:
ILocalSyncElement, IRemoteSyncElement

public abstract class RemoteSyncElement
extends LocalSyncElement
implements IRemoteSyncElement

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. A standard abstract class that provides implementations for interesting IRemoteSyncElement methods. The members method provided will create a unified tree based on the local, base, and remote children. The getSyncKind method will calculate the relative sync kind of the remote node.

Since:
2.0

Field Summary
 
Fields inherited from interface org.eclipse.team.core.sync.ILocalSyncElement
ADDITION, AUTOMERGE_CONFLICT, CHANGE, CHANGE_MASK, CONFLICTING, DELETION, DIRECTION_MASK, GRANULARITY_CONTENTS, GRANULARITY_CONTENTS_IGNORE_WHITESPACE, GRANULARITY_TIMESTAMP, IN_SYNC, INCOMING, MANUAL_CONFLICT, OUTGOING, PSEUDO_CONFLICT
 
Constructor Summary
RemoteSyncElement()
           
 
Method Summary
protected  boolean compare(int granularity, boolean force, IRemoteResource e1, IRemoteResource e2, IProgressMonitor monitor)
           
protected  boolean compare(int granularity, boolean force, IResource e1, IRemoteResource e2, IProgressMonitor monitor)
          Helper methods for comparisons that returns true if the resource contents are the same.
abstract  IRemoteSyncElement create(boolean isThreeWay, IResource local, IRemoteResource base, IRemoteResource remote, Object data)
          Creates a client specific sync element from a local, base, and remote resources.
 int getSyncKind(int granularity, IProgressMonitor progress)
          Performs a synchronization calculation on the given element based on the local and base resources.
protected  boolean isGranularityContents(int granularity)
           
static String kindToString(int kind)
           
 ILocalSyncElement[] members(IProgressMonitor progress)
          Answers and array of ILocalSyncElement elements that are immediate children of this sync element, in no particular order.
protected abstract  boolean timestampEquals(IRemoteResource e1, IRemoteResource e2)
           
protected abstract  boolean timestampEquals(IResource e1, IRemoteResource e2)
           
 String toString()
           
 
Methods inherited from class org.eclipse.team.core.sync.LocalSyncElement
create, equals, getData, getName, isContainer, isIgnored
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.team.core.sync.IRemoteSyncElement
getRemote, isThreeWay
 
Methods inherited from interface org.eclipse.team.core.sync.ILocalSyncElement
getBase, getLocal, getName, isContainer
 

Constructor Detail

RemoteSyncElement

public RemoteSyncElement()
Method Detail

create

public abstract IRemoteSyncElement create(boolean isThreeWay,
                                          IResource local,
                                          IRemoteResource base,
                                          IRemoteResource remote,
                                          Object data)
Creates a client specific sync element from a local, base, and remote resources. The base and remote resource may be null.

Parameters:
local - the local resource in the workbench. Will never be null.
base - the base resource, may me null.
remote - the remote resource, may be null.
data - client specific data.
Returns:
a client specific sync element.

members

public ILocalSyncElement[] members(IProgressMonitor progress)
                            throws TeamException
Description copied from interface: ILocalSyncElement
Answers and array of ILocalSyncElement elements that are immediate children of this sync element, in no particular order. The returned sync nodes are a combination of the nodes represented by the sync element (e.g. local, base, remote).

Specified by:
members in interface ILocalSyncElement
Overrides:
members in class LocalSyncElement
Throws:
TeamException

getSyncKind

public int getSyncKind(int granularity,
                       IProgressMonitor progress)
Description copied from interface: ILocalSyncElement
Performs a synchronization calculation on the given element based on the local and base resources. Returns an integer describing the synchronization state of this element.

Specified by:
getSyncKind in interface ILocalSyncElement
Overrides:
getSyncKind in class LocalSyncElement

compare

protected boolean compare(int granularity,
                          boolean force,
                          IResource e1,
                          IRemoteResource e2,
                          IProgressMonitor monitor)
Helper methods for comparisons that returns true if the resource contents are the same. If timestampDiff is true then the timestamps don't differ and there's no point checking the contents.


compare

protected boolean compare(int granularity,
                          boolean force,
                          IRemoteResource e1,
                          IRemoteResource e2,
                          IProgressMonitor monitor)

timestampEquals

protected abstract boolean timestampEquals(IResource e1,
                                           IRemoteResource e2)

timestampEquals

protected abstract boolean timestampEquals(IRemoteResource e1,
                                           IRemoteResource e2)

isGranularityContents

protected boolean isGranularityContents(int granularity)

toString

public String toString()

kindToString

public static String kindToString(int kind)

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.